// 这里是路由的配置文件
import {createRouter, createWebHashHistory} from 'vue-router'
import HomePage from '../views/HomePage.vue'
import MapPage from "@/views/MapPage.vue";
import BookPage from "@/views/BookPage.vue";
import MyPage from "@/views/MyPage.vue";
import SearchPage from "@/views/SearchPage.vue";

const routes = [
  {
    path: '/home',
    component: HomePage,
    name: 'HomePage'
  },
  {
    path: '/map',
    component: MapPage,
    name: 'MapPage'
  },
  {
    path: '/book',
    component: BookPage,
    name: 'BookPage'
  },
  {
    path: '/account',
    component: MyPage,
    name: 'MyPage'
  },
  {
    path: '/search',
    component: SearchPage,
    name: 'SearchPage'
  },
  {
    path: '/',
    redirect: '/home'
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
